Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

449
Visualizações
Identity in ASP.Net Core 2.1< - Customize AccountController

I have installed ASP.NET Core 2.1 but even though I have created a new ASP.NET Core Web Application using ASP.NET Core 2.1 with Individual User Accounts → Store user accounts in-app I can't find the AccountController or Views.

I can still register and login without a problem but I can't find the code for it, it were present in 2.0.

enter image description here

over 4 years ago · Santiago Trujillo
6 Respostas
Responde à pergunta

0

One of the changes in 2.1 was Razor Class Libraries and the default identity lives in one of these in the individual auth templates. If you would like to have the code in your app so you can customise it, you can scaffold it out with Visual Studio, or with the global scaffolder tool. See this guide on how to do both.

over 4 years ago · Santiago Trujillo Relatório

0

Turns out ASP.NET Core Identity is now available as a prebuilt package called Microsoft.AspNetCore.Identity.UI.

You can read more about it here:

https://blogs.msdn.microsoft.com/webdev/2018/03/02/aspnetcore-2-1-identity-ui/

over 4 years ago · Santiago Trujillo Relatório

0

Since ASP.NET Core 2.1 the identity UI is shipped as a library.

But you can override the views and controllers by placing them at the right locations (e.g. View/Account/Login.cshtml).

over 4 years ago · Santiago Trujillo Relatório

0

ASP.NET Core 2.1 introduced new feature called Razor class libraries that lets you build views and pages as part of reusable library. ASP.NET Core Identity was moved to such RCL. You can override it in your project:

  1. From Solution Explorer, right-click on the project > Add > New Scaffolded Item.
  2. From the left pane of the Add Scaffold dialog, select Identity > ADD.
  3. In the ADD Identity dialog, choose files you wish to override.
    1. Select layout if necessary
    2. Select or create Data context class.
  4. Hit ADD.

For more information visit documentation.

over 4 years ago · Santiago Trujillo Relatório

0

My solution is create project with .net core 2.0, and then update the framework to 2.1 and all the dependence to latest version

over 4 years ago · Santiago Trujillo Relatório

0

As far as I am aware, the AccountController code has been moved to Razor pages (and their code behinds) and works best using defaults so to customise the code you can Scaffold (ie create the files in the right place) from a brand new Net Core 2.1 project by right-clicking the Project in Visual Studio 2017 and seleting Add => New Scaffolded Item => Identity which opens a Select Dialog. Choose desired pages and there you go. Just change the pages you want and copy to same place in an Identity enabled project as these new pages automatically override the defaults. This is the new way to customize authentication/authorization using Identity not sure whether many consider this significant progress!

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda